package top.juntech.msweathercity.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.juntech.msweathercity.service.CityDataService;
import top.juntech.msweathercity.vo.City;

import java.util.List;

@RestController
@RequestMapping("/cities")
public class CityDataController {

    @Autowired
    private CityDataService cityDataService;
    @GetMapping
    public List<City> listCity() throws Exception {
        return cityDataService.listCity();
    }
}
